import { createApp } from 'vue';
/**
 * 方式一、完整引入
 * import ElementPlus from "element-plus";
 * import "element-plus/lib/theme-chalk/index.css";// 样式文件需要单独引入
 */
/**
 * 方式二、按需加载
 * Element Plus 为 app.config.globalProperties 添加了全局方法 $notify
 */
import bootstrapElement from '@/utils/bootstrap-element';
import ElementLocale from 'element-plus/lib/locale';
import lang from 'element-plus/lib/locale/lang/zh-cn';
import 'dayjs/locale/zh-cn';
import i18n from '@/utils/i18n';
import customDirective from '@/directives';
import App from './App.vue';
import router from './router';
import store, { key } from './store';
import '@/assets/css/tailwind.css';
import '@/assets/css/index.css';
import '@/assets/css/waves.css';
import '@/icons'; // src/icons/index.ts

// 通过 babel-plugin-component 插件按需引入 Element Plus: 实现国际化
ElementLocale.use(lang);
ElementLocale.i18n(i18n.global.t);

const app = createApp(App);

// 全局配置
app.config.globalProperties.$ELEMENT = {
  size: 'small',
  zIndex: 3000,
};

app.use(bootstrapElement);
app.use(customDirective);

app
  .use(store, key)
  .use(router)
  .mount('#app');
